﻿@model BrnMall.Web.StoreAdmin.Models.NewsListModel

@section header{
<title>内容列表-内容管理</title>
<link type="text/css" rel="stylesheet" href="/admin_store/css/site.css" />
<script type="text/javascript" src="/admin_store/scripts/jquery.js"></script>
<script type="text/javascript" src="/admin_store/scripts/showlist.js"></script>
<link rel="stylesheet" type="text/css" href="/components/jbox/Skins/Default/jbox.css" />
<script type="text/javascript" src="/components/jbox/jquery.jBox-2.3.min.js"></script>
<script type="text/javascript" src="/admin_store/scripts/selectlist.js"></script>
<script type="text/javascript" src="/admin_store/scripts/news.js"></script>
}

@section body{
<h1 class="rightH1">
    微信小程序 &gt; 内容管理 &gt; <span class="rightH1-cur">内容列表</span>
<div class="right">
<a href="@Url.Action("addnews")" class="menuBT"><img src="/admin_store/images/add.jpg" />添加内容</a>
<div class="clear"></div>
</div>
<div class="clear"></div>
</h1>
@using (Html.BeginForm("newslist", "news"))
{
    
<div class="dataListSearch">
    <table height="32">
        <tbody class="col2">
            <tr>
                <td class="td1">内容类型：@Html.DropDownListFor(x => x.NewsTypeId, Model.NewsTypeList)</td>
                <td class="td2">内容标题：@Html.TextBox("NewsTitle", Model.NewsTitle, new { height = "18" })</td>
                <td><input id="SearchNews" name="SearchNews" type="image" class="searchBut submit" src="/admin_store/images/s.jpg" /></td>
            </tr>
        </tbody>
    </table>
</div>

<div class="dataList">
<table width="100%">
<thead>
  <tr>
    <th width="40" align="center"><input type="checkbox" id="allSelect"/></th>
    <th width="60" align="left">编号</th>
    <th width="150" align="left">类型</th>
    <th align="left">标题</th>
    <th width="60" align="left">显示</th>
    <th width="60" align="left">置顶</th>
    <th width="60" align="left">置首</th>
    <th width="60" align="left">排序</th>  
    <th width="96" align="left">管理操作</th>
    </tr>
</thead>
  <tbody>
  @foreach (DataRow row in Model.NewsList.Rows)
  {
  <tr>
    <td align="center"><input type="checkbox" value="@row["newsid"]" selectItem="true" name="newsIdList" /></td>
    <td>@row["newsid"]</td>
    <td>@row["name"]</td>
    <td>@row["title"]</td>
    <td>
        @{
            if (row["isshow"].ToString() == "0")
            {
                <span style="cursor:pointer" url="@Url.Action("ChangeNewsIsShow", new { newsid = row["newsid"] })" isshow="0" class="isshowspan">
                    否
                </span>
            }
            else
            {
                <span style="cursor:pointer" url="@Url.Action("ChangeNewsIsShow", new { newsid = row["newsid"] })" isshow="1" class="isshowspan">
                    是
                </span>
            }
        }
    </td>
    <td>
        @{
            if (row["istop"].ToString() == "0")
            {
                <span style="cursor:pointer" url="@Url.Action("ChangeNewsIsTop", new { newsid = row["newsid"] })" istop="0" class="istopspan">
                    否
                </span>
            }
            else
            {
                <span style="cursor:pointer" url="@Url.Action("ChangeNewsIsTop", new { newsid = row["newsid"] })" istop="1" class="istopspan">
                    是
                </span>
            }
        }
    </td>
    <td>
     @{
         if (row["ishome"].ToString() == "0")
         {
            <span style="cursor:pointer" url="@Url.Action("ChangeNewsIsHome", new { newsid = row["newsid"] })" ishome="0" class="ishomespan">
                否
            </span>
         }
         else
         {
            <span style="cursor:pointer" url="@Url.Action("ChangeNewsIsHome", new { newsid = row["newsid"] })" ishome="1" class="ishomespan">
                是
            </span>
         }
    }
    </td>
      <td>
          <input type="text" url="@Url.Action("ChangeNewsisOrder", new { newsid = row["newsid"] })" value="@row["displayorder"]" class="sortinput unselectedsortinput" />
      </td>
    <td>
        @Html.ActionLink("编辑", "editnews", new { newsId = row["newsid"] }, new { @class = "editOperate" })&nbsp;|&nbsp;
        @Html.ActionLink("删除", "delnews", new { newsIdList = row["newsid"] }, new { @class = "deleteOperate" })
    </td>
    </tr>
  }
</tbody>
</table>
</div>
<div class="dataListEdit">
<a href="#" delUrl="@Url.Action("delnews")" class="batch batchDel">批量删除</a>
<div class="page">
    @Html.MallAdminPager(Model.PageModel)
</div>
</div>
}
}